home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Games / dynamite / developer / e / dynAMIte.e < prev    next >
Text File  |  2002-10-28  |  8KB  |  259 lines

  1. -> NOREV
  2. OPT MODULE
  3. OPT EXPORT
  4.  
  5. MODULE  'exec/nodes',
  6.         'exec/lists',
  7.         'exec/semaphores'
  8.  
  9. -> player.status
  10. ENUM  PA_NONE=0, -> no player
  11.       PA_VISI,   -> player is visitor
  12.       PA_LOGGEDIN, -> player just logged in/after a game
  13.       PA_PLAYING,  -> player is in game (no matter if he's dead)
  14.       PA_COUNTDOWN, -> this is of no use. players only have this status if they logged in.
  15.       PA_DEAD, -> this is of no use, it's not meant to see if a player is
  16.                -> actually dead.  use player.dead instead.  it's only set
  17.                -> after a successfull login for the other players
  18.       PA_WON -> a player has this status if he won the last round
  19.  
  20. -> dynasema.gamerunning
  21. ENUM  GAME_NOTCONNECTED=0, -> game is not connected (startscreen)
  22.       GAME_CLOSEGAME,      -> transitional state to GAME_NOTCONNECTED after connection got closed
  23.       GAME_MENU,           -> game is in menu eg: login screen
  24.       GAME_ENDGAME,        -> transitional state to GAME_MENU after effect has been drawn
  25.       GAME_EFFECT,         -> game draws effect after a match
  26.       GAME_COUNTDOWN,      -> game is doing the countdown
  27.       GAME_GAME,           -> game is running
  28.       GAME_HURRYUP         -> game is running and is in hurry up mode
  29.  
  30. ENUM  DIR_NONE=-1,
  31.       DIR_DOWN,
  32.       DIR_RIGHT,
  33.       DIR_LEFT,
  34.       DIR_UP
  35.  
  36. CONST SPEED_NORMAL=4,
  37.       SPEED_SLOW=3,
  38.       SPEED_FAST=6
  39.  
  40. CONST BLOCK_FAKEBLOCK=-1,    -> used for remote/kick bombs which are placed into the map
  41.       BLOCK_NOBLOCK=0,       -> empty field
  42.       BLOCK_HARDBLOCK=1,     -> non-destroyable block
  43.       BLOCK_DESTROYABLE=2,   -> destroyable block
  44.       BLOCK_BOMB=3,          -> normal bomb
  45.       BLOCK_BORDERWALL1=4,   -> borderblocks are equal to hardblock
  46.       BLOCK_BORDERWALL2=5,
  47.       BLOCK_BORDERWALL3=6,
  48.       BLOCK_BORDERWALL4=7,
  49.       BLOCK_BORDERWALL5=8,
  50.       BLOCK_BORDERWALL6=10,
  51.       BLOCK_BORDERWALL7=11,
  52.       BLOCK_BORDERWALL8=12,
  53.       BLOCK_BORDERWALL9=13,
  54.       BLOCK_BORDERWALL10=14,
  55.       BLOCK_BORDERWALL11=15,
  56.       BLOCK_BORDERWALL12=16,
  57.  
  58.       BLOCK_ADDBOMB=19,    -> block that contains a bomb
  59.       BLOCK_GRAVESTONE=20,
  60.       BLOCK_STRONG=21
  61.  
  62. ENUM  BO_EXPANDFLAME=1, -> types for bonusgrid
  63.       BO_ADDBOMB,
  64.       BO_FLAMEMAX,
  65.       BO_BOMBMAX,
  66.       BO_RANDOMWALL,  -> 5
  67.       BO_BOMBS2BLOCKS,
  68.       BO_DROPALL,
  69.       BO_EXPLALL,
  70.       BO_FASTER,
  71.       BO_SLOWER,      -> 10
  72.       BO_SHORTERFUSE,
  73.       BO_LONGERFUSE,
  74.       BO_SHORTERFLAME,
  75.       BO_SWAPCONTROLSRL,
  76.       BO_FEWERBOMBS,  -> 15
  77.       BO_NODROP,
  78.       BO_SHIELD,
  79.       BO_STANDSTILL,
  80.       BO_TELEPORT,
  81.       BO_REMOTEBOMB,  -> 20
  82.       BO_BACK2BASIC,
  83.       BO_KICKBOMB,
  84.       BO_SABER,
  85.       BO_SWAPCONTROLSUD,
  86.       BO_MAGNET,      -> 25
  87.       BO_PHOENIX,
  88.       BO_DOHURRYUP,
  89.       BO_INVISIBLE,
  90.       BO_DUELL,
  91.       BO_AFTERBURNER,  -> 30
  92.       BO_FLAG,
  93.       BO_TELEPORTALL,
  94.       BO_MAPJUMP,
  95.       BO_DARKNESS,
  96.       BO_SWAPPOSITIONS, -> 35
  97.       BO_WORMHOLE,
  98.       BO_FART,
  99.       BO_MAX
  100.  
  101. -> types for tempbomb.type
  102. ENUM  BOMB_NORMAL=0,  -> normal bomb
  103.       BOMB_ABOMB,
  104.       BOMB_GEN,       -> predefined bomb (map)
  105.       BOMB_REMOTE,    -> remote bomb
  106.       BOMB_KICK       -> kick bomb
  107.  
  108. OBJECT serverdata
  109.   servername[34]:ARRAY -> name of the server
  110.   sysopname[18]:ARRAY  -> name of the sysop
  111.   maxslots:INT         -> how many players allows this server
  112.   maxobservers:INT     -> how many observers allows this server
  113. ENDOBJECT
  114.  
  115. OBJECT tempbomb
  116.   ln:mln
  117.  
  118.   x:INT -> x blockpos
  119.   y:INT -> y blockpos
  120.  
  121.   x1:INT -> x pos (pixel)
  122.   y1:INT -> y pos (pixel)
  123.  
  124.   fuse:INT -> >0 bomb is still ticking; =0 bomb is going to explode
  125.   range:LONG -> flamlength
  126.  
  127.   dir:INT -> in case of kick/remote bomb holds the direction
  128.  
  129.   originx:INT -> holds the x/y pos (block) where the bomb was placed
  130.   originy:INT -> (useful to find kick/remotebombs)
  131.  
  132.   type:INT -> is set to one of BOMB_#?
  133.  
  134.   player:INT
  135.   playerobject:PTR TO LONG
  136.   /******* private data *******/
  137.  
  138. ENDOBJECT
  139.  
  140. OBJECT player
  141.   num:INT
  142.   status:LONG -> this is set to one of PA_#?
  143.  
  144.   dead:INT -> >0 = player is alive
  145.  
  146.   x:INT -> xpos (pixel) + border (24 pixel)
  147.   y:INT -> ypos (pixel) + border (16 pixel)
  148.  
  149.   px:INT -> xpos (block number)
  150.   py:INT -> ypos (block number)
  151.  
  152.   bombc:INT -> how many bombs this player has currently ticking
  153.   maxkickbombs:INT -> how many kickbombs this player has
  154.   ->bomblist:PTR TO mlh -> doubly linked list of bombs belonging to this player
  155.  
  156.   remotebomb:PTR TO tempbomb -> obsolete
  157.  
  158.   maxrange:INT -> flamelen of player ranging from 2 to 15
  159.   maxbombs:INT -> how many bombs this player can drop
  160.   fuselen:INT -> fuselength of bombs the player can drop
  161.   speed:INT -> player speed; SPEED_NORMAL=4, SPEED_SLOW=3, SPEED_FAST=6
  162.   speedc:INT -> >0 = player has other speed (SPEED_SLOW, SPEED_FAST)
  163.  
  164.   swaprlc:INT -> >0 = swaped horizontal controls
  165.   swapudc:INT -> >0 = swaped vertical controls
  166.   nodropc:INT -> >0 = player can't drop bombs
  167.  
  168.   shieldc:INT -> >0 = player has shield
  169.  
  170.   standstillc:INT -> >0 = player can't move
  171.  
  172.   invisiblec:INT -> >0 = player is invisible
  173.  
  174.   afterburnerc:INT -> >0 = player has afterburner
  175.  
  176.   b2bc:INT
  177.  
  178.   flamethrowerc:INT -> >0 = player has lightsabre
  179.   flamethrowerdir:INT -> direction of lightsabre
  180.   flamethrowerr:INT -> range of light sabre
  181.  
  182.   magnetc:INT -> >0 = this player has magnet enabled
  183.   magnetdir:INT -> direction of magnet
  184.  
  185.   name[34]:ARRAY -> players name
  186.   system[64]:ARRAY -> players systemstring
  187.  
  188.   dir:INT -> players direction
  189.  
  190.   fartc:INT
  191.   virusc:INT
  192.  
  193.   puppet:INT
  194.   /******* private data *******/
  195.  
  196. ENDOBJECT
  197.  
  198. OBJECT dynamitesemaphore
  199.   sema:ss -> embedded signalsemaphore
  200.  
  201.   opencnt:LONG -> you must increase this by 1 if you are going to use the
  202.                -> semaphore the first time. decrease it by 1 if you are done
  203.  
  204.   quit:LONG -> dynamite will set this to 1 if it wants to quit.  Check this
  205.             -> from time to time and end your program if quit gets set to 1
  206.  
  207.   gamerunning:LONG -> is set to one of GAME_#?
  208.  
  209.   frames:LONG -> once a game is running this long will be increased by 1
  210.               -> every frame.
  211.  
  212.   walk:LONG     -> set to one of DIR_ to make the player move or stop
  213.   drop:LONG     -> set to 1 to drop a bomb
  214.   dropkick:LONG -> set to 1 to drop a kickbomb
  215.  
  216.   thisplayer:LONG -> number of this player in playerarray (>7 = observer)
  217.   player:PTR TO LONG -> array ptr of players (15 entries max; >7 = observer)
  218.  
  219.   mapwidth:LONG  -> holds the width of the map in blocks
  220.   mapheight:LONG -> holds the height of the map in blocks
  221.  
  222.   grid:PTR TO LONG -> array ptr to the actual map (29 entries max). each entry contains 1 line of the map without powerups
  223.                    -> each element of line is INT sized
  224.  
  225.   bonusgrid:PTR TO LONG -> array ptr to the bonus map (29 entries max). each entry contains 1 line of the bonusmap
  226.                         -> each element of line is CHAR sized
  227.  
  228.   addbubble:PTR TO CHAR -> setting this pointer to a string will make
  229.                         -> dynamite show the string given here as bubble.
  230.                         -> dynamite will reset this pointer to 0 after
  231.                         -> successfull creation of the bubble
  232.  
  233.   serverdata:PTR TO serverdata -> see serverdata for details
  234.  
  235.   explosiongrid:PTR TO LONG -> array ptr to the explosion map (29 entries max). each entry contains 1 line of the explosion map
  236.                             -> this map reflects where currently explosions are (explosion=1)
  237.                             -> each element of line is CHAR sized
  238.  
  239.   version:LONG -> holds the version of dynamite (e.g. 45)
  240.  
  241.   botinfo:PTR TO LONG -> pointer to an array of 255 (so 255 bots max are
  242.                       -> supported with this array) long pointers to hold a
  243.                       -> string (versioninfo, description) of your bot.
  244.                       -> You should set the entry for your bot after
  245.                       -> opencnt has been increased by your bot and set it
  246.                       -> back to NULL if your bot is about to decrease the
  247.                       -> opencnt again on quit.
  248.  
  249.                       -> entry for your bot in this array is opencnt after
  250.                       -> increasing (on botstartup, see example)
  251.  
  252.   bomblist:PTR TO mlh -> doubly linked list of bombs
  253.  
  254.   suicide:LONG -> set to 1 to kill bot/player
  255.  
  256.   teammode:INT
  257.  
  258. ENDOBJECT
  259.